package com;

import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;

public class TestStreamList {

	public static void main(String[] args) {
		List<String> list = new ArrayList<String>();
		for(int i=1;i<=30;i++) {
			list.add(i+"");
		}
		System.out.println(list.size());
		System.out.println(list);
		addNullFull(list, 19);
		System.out.println(list);
		addNullFull(list, 32);
		System.out.println(list);
		list = list.subList(0, 10);
		System.out.println(list);
		/**
		int total = list.size();
		int pageSize = 4;
		int pageSum = (total -1) / pageSize +1;
		
		for(int pageNo = 1; pageNo <= pageSum; pageNo++) {
			List<Object> subList = list.stream().skip((pageNo-1)*pageSize).limit(pageSize).
					collect(Collectors.toList());
			for(Object s : subList) {
				System.out.print(s.toString() + " ");
			}
			System.out.println();
		}
		**/
		
	}
	
	
	public static void addNullFull(List<String> thinklist, int length) {
		for(int i = thinklist.size(); i < length; i++) {
			thinklist.add(null);
		}
	}
}
